package com.jeffcode.lb.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LBController {
    @GetMapping(value = "/sum/{a}/{b}")
    public Integer sum(@PathVariable("a") Integer a, @PathVariable("b") Integer b) {
        return a+b;
    }

    @GetMapping(value = "/sub/{a}/{b}")
    public Integer sub(@PathVariable("a") Integer a, @PathVariable("b") Integer b) {
        return a-b;
    }

    @GetMapping(value = "/mul/{a}/{b}")
    public Integer mul(@PathVariable("a") Integer a, @PathVariable("b") Integer b) {
        return a*b;
    }

    @GetMapping(value = "/div/{a}/{b}")
    public Integer div(@PathVariable("a") Integer a, @PathVariable("b") Integer b) {
        return a/b;
    }
}
